<template>
  <div class="out-style">
    <ach-detail :title="title" isReview="true"></ach-detail>
    <el-form label-width="120px" ref="ruleForm">
      <el-tabs class="tabs" v-model="tabName" v-if="trackList.length">
        <el-tab-pane
          v-for="item in trackList"
          :key="item.id"
          :label="item.trackCount"
          :name="item.id + ''"
        >
          <div>
            <p class="divider"></p>
            <div class="mian-title">{{$t('message.fbcx')}}</div>
            <div class="inner-style">
              <el-form-item :label="$t('message.fbxg')+':'">
                <span style="padding-right: 10px;">{{item.publishEffect}}</span>
                <span>{{item.remark}}</span>
              </el-form-item>
              <el-form-item :label="$t('message.cgms')+':'">{{item.resultDesc}}</el-form-item>
              <el-form-item v-if="item.ossUrlList.length!==0" :label="$t('message.scfj')+':'">
                <down-load :pfileList="item.ossUrlList"></down-load>
              </el-form-item>
            </div>
            <p class="divider"></p>
            <div class="mian-title">{{$t('message.txrxx')}}</div>
            <div class="inner-style">
              <el-form-item :label="$t('message.tbr')+':'">{{item.filledBy}}</el-form-item>
              <el-form-item :label="$t('message.lxdh')+':'">{{item.phone}}</el-form-item>
              <el-form-item :label="$t('message.zjhm')+':'">{{item.seatNumber}}</el-form-item>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </el-form>
    <div class="backBnt">
      <el-button type="primary" @click="back">{{$t('message.fh')}}</el-button>
    </div>
  </div>
</template>


<script>
import achDetail from "@components/achDetail.vue";
import downLoad from "@components/uploadFile/downLoad.vue";
export default {
  data() {
    return {
      title: this.$t("message.ck-title"),
      tabName: "",
      trackList: [], // 追踪列表
      cfileList: []
    };
  },
  components: {
    achDetail,
    downLoad
  },
  mounted() {
    // 如果在追踪状态，需要获取追踪数据
    console.log(+this.$route.query.stat === 1);

    if (+this.$route.query.stat === 1) {
      // 审核记录 + 追踪信息回填
      this.$axios
        .get("/api/releaseResultTrack/getInfos", {
          params: {
            id: this.$route.query.id
          }
        })
        .then(res => {
          if (res.code === 200) {
            this.trackList = res.data;
            this.tabName = res.data[0].id + "";
            // document.getElementsByClassName('el-tabs__nav')[0].style['max-width'] = '1400px'
            // document.getElementsByClassName('el-tabs__nav')[0].style['overflow-x'] = 'scroll'
          } else {
            this.$message.error(res.message);
          }
        })
        .catch(err => {
          console.log(err);
        });
    }
  },
  methods: {
    back() {
      this.$router.push("/achievements");
    }
  }
};
</script>

<style lang="scss" scoped>
.out-style {
  width: 100%;
  background: #fff;
  padding: 60px 120px;
}
.inner-style {
  width: 100%;
  margin: 0 auto;
}
h2 {
  margin: 0 0 30px;
  font-size: 18px;
  text-align: center;
}
.el-input {
  width: 80%;
}
.add-parties {
  margin-left: 12px;
}
.divider {
  width: 100%;
  border-top: 1px dashed #d9e1e9;
  margin-top: 12px;
}
.mian-title {
  font-weight: 500;
  color: rgba(51, 51, 51, 1);
  line-height: 16px;
  font-size: 16px;
  border-left: 4px solid #fe8c01;
  padding-left: 10px;
  margin: 12px 0 24px 0;
}
.select {
  width: 120px;
}
.select1 {
  width: 120px;
  margin-left: 20px;
}
.select2 {
  width: 280px;
  margin-left: 20px;
}
.bnt {
  text-align: center;
  margin: 40px 0 50px 0;
}
.submit {
  width: 171px;
  height: 40px;
  margin-right: 46px;
  color: rgba(255, 255, 255, 1);
  border: none;
  background: linear-gradient(
    90deg,
    rgba(255, 192, 2, 1) 0%,
    rgba(254, 140, 1, 1) 100%
  );
}
.save {
  width: 171px;
  height: 40px;
  border: 1px solid rgba(151, 151, 151, 1);
  font-size: 14px;
  font-weight: 400;
  color: rgba(51, 51, 51, 1);
  background-color: #ffffff;
}
.backBnt {
  width: 100%;
  margin: 50px 0 0;
  text-align: center;
}
.backBnt button {
  width: 200px;
  height: 32px;
}
.tabs {
  ::v-deep .el-tabs__nav-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 2px;
    background-color: #e4e7ed;
    z-index: 1;
  }
  ::v-deep .el-tabs__header{
      line-height: 88px !important;
    }
  ::v-deep .el-tabs__active-bar{
      transform: translateY(-25px) !important;
  }
}
</style>